package org.phalanx.client.dialogs.servernode;

import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.util.Vector;

import javax.swing.BoxLayout;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.ScrollPaneConstants;

public class PhalanxServerNodeListPanel extends JPanel{
	private ServerNodeConnectionPanel masterPanel;
	private JList serverNodeList;
	
	public PhalanxServerNodeListPanel(ServerNodeConnectionPanel masterPanel){
		this.masterPanel = masterPanel;
		initialize();
		setUpComponents();
		setUpPanel();
	}
	
	private void initialize(){
		this.setBackground(Color.black);
		this.setLayout(new GridBagLayout());
	}
	
	private void setUpComponents(){
		Vector v = new Vector();
		v.add("Hello");
		
		serverNodeList = new JList();
		//serverNodeList.setListData(v);
	}
	
	private void setUpPanel(){
		GridBagConstraints c = new GridBagConstraints();
		c.gridx = 0;
		c.gridy = 0;
		c.weightx = 1;
		c.weighty = 1;
		c.fill = GridBagConstraints.BOTH;
		
		JScrollPane p = new JScrollPane(serverNodeList);
		p
		.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
		p
		.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
		
		this.add(p, c);
	}
}
